//Main Implementation

#include "checkout.h"
#include "control.h"
#include "Customer_Obj.h"
#include "Deli.h"
#include "master.h"
#include "node.h"
#include "queue.h"
#include "shop.h"
#include "sweeps.h"
#include "sweeps.h"
#include "Time.h"

#include <iostream>
using namespace std;

int main(){
    
    sync sync_object; cout << "Sync Object Completed." << endl;
    control control_object; cout << "Control Objects Completed." << endl;
    
    sync *syncP = &sync_object;
    control *controlP = &control_object; cout << "Sync and Control Pointers Completed." << endl;
    
    sweeps sweeps_object(syncP, controlP); cout << "Sweepstakes Object Completed." << endl;
    
    sweeps *sweepsP = &sweeps_object; cout << "Sweepstakes Pointer Completed." << endl;
    
    Deli deli_object(syncP, controlP, sweepsP); cout << "Deli Object Completed." << endl;
    
    Deli *deliP = &deli_object; cout << "Deli Pointer Completed." << endl;
    
    shop shop_object(syncP, controlP, sweepsP, deliP); cout << "Shop Object Completed." << endl;
    
    shop *shopP = &shop_object; cout << "Shop Pointer Completed." << endl;
    
    checkout checkout_object(syncP, shopP); cout << "Checkout Object Completed." << endl;
    
    checkout *checkoutP = &checkout_object; cout << "Shop Pointer Completed." << endl;
    
    master master_object(syncP, controlP, sweepsP, deliP, shopP, checkoutP); cout << "Master Object Completed." << endl;
    
    master_object.update_sync();
    
    while(sync_object.return_time() < 1440){
                                    cout << "Simulation Run for Time: " << sync_object.return_time() << endl;
                                    master_object.run_sim();
                                    
    }
    
    master_object.for_the_win();
    
    system("PASUE");
    return(0);

}
